const gulp = require('gulp')
const cssmin = require('gulp-cssmin')
const autoprefixer = require('gulp-autoprefixer')
const htmlmin = require('gulp-htmlmin')
const uglify = require('gulp-uglify')
const babel = require('gulp-babel')
const del = require('del')
const webserver = require('gulp-webserver')

const imagesHandler = ()=>{
    return gulp.src('./src/images**')
    .pipe(gulp.dest('./dist/images'))
}
const cssHandler = ()=>{
    return gulp.src('./src/css/*.css')
    .pipe(autoprefixer())
    .pipe(cssmin())
    .pipe(gulp.dest('./dist/css'))
}
const libHandler = ()=>{
    return gulp.src('./src/lib/**')
    .pipe(gulp.dest('./dist/lib'))
}
const htmlHandler = ()=>{
    return gulp.src('./src/pages/**')
    .pipe(htmlmin({
        collapseBooleanAttributes:true,
        collapseWhitespace:true,
        removeComments:true,
        removeAttributeQuotes:true,
        minifyJS:true,
        minifyCSS:true
    }))
    .pipe(gulp.dest('./dist/pages'))

}